package com.achen.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author achen
 * @create 2020-05-10 14:03
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Accessors(chain = true) //开启链式调用
@EqualsAndHashCode
@TableName("t_user") //value可以省略，或者写成value="t_user"
public class User implements Serializable {
    @TableId(value = "id",type = IdType.AUTO) //自动生成id
    private Integer id;
    @TableField("username") //给列名起别名，让mp知道去数据库查哪个字段
    private String name;
    private Integer age;
    private Date bir;
    @TableField(exist = false) //不映射数据库表的任何字段
    private List<User> userList;
}
